<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="initial-scale=1.0,maximum-scale=1.0"/>
		<title></title>
	</head>
	<body>
		<p></p>
		<p></p>
		<p></p>
		<p></p>
	</body>
	<script type="text/javascript">
		var msg = document.querySelectorAll("p");
		function gestureFn(event){
			switch (event.type){
				case "gesturestart":{
					msg[0].innerHTML = "两个手指已触发";
					break;
				}
				case "gesturechange":{
					msg[1].innerHTML = "rotation:" + event.rotation + ",scale:" + event.scale;
					break;
				}
				case "gestureend":{
					alert("haha")
					break;
				}
				default:
					break;
			}	
		}
		//判断是不是有两个手指触屏
		window.addEventListener("gesturestart",gestureFn,false);
		//判断是不是两个手指在滑动，并且可以看出来rotation 和 scale
		window.addEventListener("gesturechange",gestureFn,false);
		//判断是不是手指离开。否则不足与成为手势
		window.addEventListener("gestureend",gestureFn,false);
	</script>
</html>
